package com.zhiyou100.config;

import com.zhiyou100.interceptor.InterceptorTest01;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 过滤器配置类
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-10-20 09:32
 */
@Configuration
public class InterceptorConfigure extends WebMvcConfigurationSupport {
    @Autowired
    private InterceptorTest01 interceptorTest01;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(interceptorTest01).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
